#include"Sort.h"

void test1()
{
	int arr[] = { 3,1,5,6,2,4,7,9,8,0 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	PrintArray(arr, sz);
	QuickSort(arr, 0, sz - 1);
	QuickSort(arr, 0, sz - 1);
	//PartSort3(arr, 0, sz - 1);
	PrintArray(arr, sz);
}
void test1Op()
{
	int N = 3576;
	/*while (N<10000)
	{*/
	printf("%d:\n", N);
	int i = 0;
	int* a1 = (int*)malloc(sizeof(int) * N);
	int* a2 = (int*)malloc(sizeof(int) * N);
	if (a1 == NULL || a2 == NULL)
		exit(-1);
	for (i = 0; i < N; i++)
	{
		a1[i] = rand();
		a2[i] = a1[i];
	}
	int begin1 = 0;
	int end1 = 0;
	begin1 = clock();
	QuickSort(a1, 0, N - 1);
	end1 = clock();
	printf("QuickSort_1:%d\n", end1 - begin1);
	begin1 = clock();
	QuickSort(a1, 0, N - 1);
	end1 = clock();
	printf("QuickSort_1:%d\n", end1 - begin1);
	//PrintArray(a1, N);
		//N++;
}
int main()
{
	srand((unsigned)time(NULL));
	//test1();
	test1Op();
	return 0;
}



